<template>
  <div class="single-item">
    <router-link :to="goodsUrl" class="avatar">
      <img v-lazy="goods.goodsMainPhotoPath" alt="">
    </router-link>
    <div class="ft">
      <div class="price clearfix">
        <h3 class="fl">￥{{goods.storePrice || 0}}</h3>
        <span class="ico-collect fr"><i></i>{{goods.goodsCollect || 0}}</span>
      </div>
      <router-link :to="goodsUrl" class="tit">{{goods.goodsName}}</router-link>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    goods: {
      type: Object,
      default: () => { return {} }
    }
  },
  computed: {
    goodsUrl() {
      return `/goods/detail/${this.goods.goodsId}`
    }
  }
}
</script>

<style lang="scss" scoped>
@import '../../../scss/_var.scss';
.single-item {
  float: left;
  width: 302px;
  .avatar {
    display: block;
    height: 302px;
  }
  .ft {
    padding: 0 8px 14px 8px;
    background: $color-white;
    font-size: 14px;
    height: 100px;
    .price {
      height: 34px;
      line-height: 34px;
    }
    h3 {
      font-size: 18px;
      color: $color-main;
      font-weight: 500;
    }
    .ico-collect {
      cursor: pointer;
      i {
        display: inline-block;
        width: 14px;
        height: 14px;
        margin-right: 2px;
        background-image: url('../../../assets/ico_list_collect.png');
      }
      &.actived {
        background-image: url('../../../assets/ico_list_collect_actived.png');
      }
    }
  }
  .tit {
    display: block;
    line-height: 18px;
  }
}
</style>